#include <iostream>
#include <cstring>
#include <thread>

int main() {
    char *p;

    p = (char *)calloc(1024 * 1024, 1);
    strcpy(p, "abcdefg");

    std::cout << ">>> p: " << static_cast<void *>(p) << " and value: " << p << std::endl;

    p = (char *)realloc(p, 20 * 1024 * 1024);
    std::cout << ">>> p: " << static_cast<void *>(p) << " and value: " << p << std::endl;
    strcpy(p + 7, "hijklmn");
    std::cout << ">>> p: " << static_cast<void *>(p) << " and value: " << p << std::endl;

    free(p);

    std::thread::id tid = std::this_thread::get_id();
    std::hash<std::thread::id> hasher;
    std::cout << ">>> tid: " << tid << std::endl;

    long int tid2 = hasher(tid);
    std::cout << ">>> tid2: " << tid2 << std::endl;

    return 0;
}
